#-*- coding: utf-8 -*-

## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.

## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.

## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

import wx

class VBHerramientas(wx.ToolBar):
    '''La barra de herrmientas principal de Pyragua'''
    def __init__(self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize,
                 style=wx.TB_HORIZONTAL | wx.NO_BORDER | wx.TB_FLAT):
        wx.ToolBar.__init__(self, parent, id, pos, size, style)
       

	#generación bmps
	new_bmp =  wx.ArtProvider.GetBitmap(wx.ART_NEW, wx.ART_TOOLBAR, (16, 16))
	open_bmp =  wx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN, wx.ART_TOOLBAR, (16, 16))
	save_bmp =  wx.ArtProvider.GetBitmap(wx.ART_FILE_SAVE, wx.ART_TOOLBAR, (16, 16))
	saveas_bmp =  wx.ArtProvider.GetBitmap(wx.ART_FILE_SAVE_AS, wx.ART_TOOLBAR, (16, 16))


	elementos_barra=[
			(wx.ID_NEW, new_bmp, 'Nuevo',u'Crear una nueva pestaña', parent.nuevo),
			(wx.ID_OPEN, open_bmp,'Abrir', 'Abrir un archivo', parent.abrir),
			(wx.ID_SAVE, save_bmp, 'Guardar','Guardar el archivo actual', parent.guardar),
			(wx.ID_SAVEAS, saveas_bmp, 'Guardar como','Posibilita guardar el archivo de manera 				diferente',parent.guardar_como),]


	for ids, bmp, etiqueta,texto, metodo in elementos_barra:
		self.AddSimpleTool(ids,bmp,etiqueta,texto)   ###se añaden los íconos a la barra y se conectan con los 									métodos.
		parent.Bind(wx.EVT_MENU, metodo, id=ids)






        
